﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Script.Serialization;

namespace JCFramework.Utilities
{
    public static class JsonUtilities
    {
        public static string JsonSerialize(this object o)
        {
            return new JavaScriptSerializer().Serialize(o);
        }

        public static void JsonSerialize(object o, StringBuilder output)
        {
            new JavaScriptSerializer().Serialize(o, output);
        }

        public static T JsonDeserialize<T>(this string input)
        {
            return new JavaScriptSerializer().Deserialize<T>(input);
        }
    }
}
